package com.circus.trace.bean.product;

import java.util.Date;
import java.util.List;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Comment;
import org.nutz.dao.entity.annotation.ManyMany;
import org.nutz.dao.entity.annotation.Table;
import org.nutz.json.JsonShape;
import org.nutz.json.JsonShape.Type;

import com.circus.trace.bean.CricusEntity;
import com.circus.trace.bean.material.Coffee;

@Table("t_product")
@Comment("产品")
public class Product extends CricusEntity {

    @JsonShape(value = Type.OBJECTWITHNAME, nameKey = "code")
    public static enum PackageType {
        Italian("意式"), Single("单品");
        String name;

        private PackageType(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

    }

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Column("p_name")
    @Comment("成品名称")
    private String name;

    @Column("p_productive_time")
    @Comment("生产时间")
    private Date productiveTime;

    @Column("p_productive_address")
    @Comment("生产地址")
    private String productiveAddress;

    @Column("p_manufacturer")
    @Comment("厂商名称")
    private String manufacturer;

    @Column("p_manufacturer_address")
    @Comment("生产商地址")
    private String manufacturerAddress;

    @Column("p_manufacturer_message")
    @Comment("生产商简介")
    private String manufacturerMessage;

    @Column("p_pes_no")
    @Comment("产品执行标准号")
    private String pesNo;

    @Column("p_fpl_no")
    @Comment("食品生产许可证编号")
    private String fplNo;

    @Column("p_hot_line")
    @Comment("厂商热线")
    private String hotLine;

    @Column("p_package_type")
    @Comment("包装类型")
    private PackageType type;

    @Column("p_storage_method")
    @Comment("储存方法")
    private String storageMethod;

    @Column("p_qgp")
    @Comment("保质期")
    private String qgp;

    @Column("p_fin")
    @Comment("厂检编号")
    private String factoryInspectionNo;

    @Column("p_fir")
    @Comment("厂检结果")
    private String factoryInspectionResult;

    @Column("p_fir_img")
    @Comment("厂检结果证书")
    private String factoryInspectionResultImgKey;

    @ManyMany(from = "pc_product_id", relation = "t_product_coffee", to = "pc_coffee_id")
    private List<Coffee> coffees;

    public List<Coffee> getCoffees() {
        return coffees;
    }

    public String getManufacturerMessage() {
        return manufacturerMessage;
    }

    public void setManufacturerMessage(String manufacturerMessage) {
        this.manufacturerMessage = manufacturerMessage;
    }

    public void setCoffees(List<Coffee> coffees) {
        this.coffees = coffees;
    }

    public String getName() {
        return name;
    }

    public String getManufacturerAddress() {
        return manufacturerAddress;
    }

    public void setManufacturerAddress(String manufacturerAddress) {
        this.manufacturerAddress = manufacturerAddress;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getProductiveTime() {
        return productiveTime;
    }

    public void setProductiveTime(Date productiveTime) {
        this.productiveTime = productiveTime;
    }

    public String getProductiveAddress() {
        return productiveAddress;
    }

    public void setProductiveAddress(String productiveAddress) {
        this.productiveAddress = productiveAddress;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getPesNo() {
        return pesNo;
    }

    public void setPesNo(String pesNo) {
        this.pesNo = pesNo;
    }

    public String getFplNo() {
        return fplNo;
    }

    public void setFplNo(String fplNo) {
        this.fplNo = fplNo;
    }

    public String getHotLine() {
        return hotLine;
    }

    public void setHotLine(String hotLine) {
        this.hotLine = hotLine;
    }

    public PackageType getType() {
        return type;
    }

    public void setType(PackageType type) {
        this.type = type;
    }

    public String getStorageMethod() {
        return storageMethod;
    }

    public void setStorageMethod(String storageMethod) {
        this.storageMethod = storageMethod;
    }

    public String getQgp() {
        return qgp;
    }

    public void setQgp(String qgp) {
        this.qgp = qgp;
    }

    public String getFactoryInspectionNo() {
        return factoryInspectionNo;
    }

    public void setFactoryInspectionNo(String factoryInspectionNo) {
        this.factoryInspectionNo = factoryInspectionNo;
    }

    public String getFactoryInspectionResult() {
        return factoryInspectionResult;
    }

    public void setFactoryInspectionResult(String factoryInspectionResult) {
        this.factoryInspectionResult = factoryInspectionResult;
    }

    public String getFactoryInspectionResultImgKey() {
        return factoryInspectionResultImgKey;
    }

    public void setFactoryInspectionResultImgKey(String factoryInspectionResultImgKey) {
        this.factoryInspectionResultImgKey = factoryInspectionResultImgKey;
    }

}
